package com.youhome.service.service.impl;


import com.youhome.common.exception.CustomException;
import com.youhome.service.mapper.DictMapper;
import com.youhome.service.model.Dict;
import com.youhome.service.service.DictService;
import com.youhome.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by chen365 on 2018/09/21.
 */
@Service
public class DictServiceImpl implements DictService {
    @Autowired
    private DictMapper dictMapper;
    
    @Override
    public List<Dict> selectByPid(Long pid) throws CustomException {
        Dict record = new Dict();
        if (!StringUtils.isEmpty(pid)) {
            record.setPid(pid);
        } else {
            record.setPid(0L);
        }
        return dictMapper.selectByBean(record);
    }
}
